using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace DD.Controls
{
    public partial class ProductPrice : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DD.Products.Product p = new DD.Products.Product();
            p = DD.Products.ProductManager.GetProduct(Convert.ToInt32(Request["PID"]));

            lbl_price1.Text = String.Format("{0:c}", p.Price);
            lbl_price1.CssClass = "Price";

            lbl_price2.Visible = false;
            if (p.OnSale)
            {
                lbl_price2.Text = String.Format("{0:c}", p.SalePrice);
                lbl_price2.Visible = true;
                lbl_price2.CssClass = "SalePrice";
                lbl_price1.CssClass = "PriceOnSale";
            }

            lbl_price3.Visible = false;
        }
    }
}